home *** CD-ROM | disk | FTP | other *** search
/ Shareware Grab Bag / Shareware Grab Bag.iso / 005 / signup.arc / SIGNUP.PAS < prev   
Encoding:
Pascal/Delphi Source File  |  1985-06-22  |  55.5 KB  |  1,624 lines

  1.  
  2.  
  3.  
  4. {Program SIGN UP! by James Edmunds                         }
  5. {Written in Turbo Pascal, originally for the purpose of    }
  6. {easing registration of youngsters into summer workshops   }
  7. {at Iberia Parish Library, and one copy donated to that    }
  8. {library. This program may be copied and used freely; if   }
  9. {you like and use the program, you are requested to send   }
  10. {25.00 to James Edmunds, PO Box 2185, New Iberia, LA 70560 }
  11.  
  12.  
  13.  
  14. program SignUp;
  15.  
  16. const
  17.     MaxNoWorkshops = 45;
  18.     MaxNoParticpants = 100;
  19.  
  20.  
  21. type
  22.     WorkshopName = string[18];
  23.     WorkshopTime = string[40];
  24.     Instructor = string[25];
  25.     Schedule = record
  26.                 WorkshopNumber: Integer;
  27.                 Workshop: WorkshopName;
  28.                 When: WorkshopTime;
  29.                 Who: Instructor;
  30.                 HowMany: Integer;
  31.                 YoungestAge: Integer;
  32.                 OldestAge: Integer;
  33.                end;
  34.     ParticName = string[30];
  35.     ParticAddr1 = string[30];
  36.     ParticAddr2 = string[30];
  37.     ParticAddr3 = string[30];
  38.     ParticPhone = string[14];
  39.     Participant = record
  40.                      PartiNumber: Integer;
  41.                      PartiName: ParticName;
  42.                      PartiAddr1: ParticAddr1;
  43.                      PartiAddr2: ParticAddr2;
  44.                      PartiAddr3: ParticAddr3;
  45.                      PartiPhone: ParticPhone;
  46.                      PartiAge: Integer;
  47.                      PartiIn1: Integer;
  48.                      PartiIn2: Integer;
  49.                      PartiIn3: Integer;
  50.                      PartiIn4: Integer;
  51.                      PartiIn5: Integer;
  52.                      PartiIn6: Integer;
  53.                      PartiIn7: Integer;
  54.                      PartiIn8: Integer;
  55.                      PartiIn9: Integer;
  56.                      PartiIn10: Integer;
  57.                      AltIn1: Integer;
  58.                      AltIn2: Integer;
  59.                      AltIn3: Integer;
  60.                      AltIn4: Integer;
  61.                      AltIn5: Integer;
  62.                      AltIn6: Integer;
  63.                      AltIn7: Integer;
  64.                      AltIn8: Integer;
  65.                      AltIn9: Integer;
  66.                      AltIn10: Integer;
  67.                   end;
  68.      RosterListing = record
  69.                         PartiRosterNumber: Integer;
  70.                         PartiRosterName: ParticName;
  71.                         PartiRosterPhone: ParticPhone;
  72.                         AltFlag: Boolean;
  73.                      end;
  74.  
  75.      Limit = record
  76.                  WorkshopLimit: Integer;
  77.                  AlternateLimit: Integer;
  78.              end;
  79.  
  80.  
  81. var
  82.    SchedFile : file of Schedule;
  83.    SchedRec: Schedule;
  84.    PartiFile: file of Participant;
  85.    PartiRec: Participant;
  86.    RostListFile: file of RosterListing;
  87.    RostRec: RosterListing;
  88.    LimitFile : file of Limit;
  89.    LimitRec : Limit;
  90.    MostWorkshops, MostAlternates: Integer;
  91.    WorkshopChoice,NumberIn,NumberAltIn,PartiAgeHold,A,B,C,D: Integer;
  92.    Number,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z: Integer;
  93.    Choice,Choic,Ch : char;
  94.    Yes, Stopper, Okay, IsOne, PrintReg, AltFlagger, FormFeed,Beep : Boolean;
  95.    AgeSkip : Boolean;
  96.    CheckForFile : file;
  97.    Entry: string[80];
  98.    RosterNumber: string[3];
  99.    RosterName: string[8];
  100.    Expression: string[80];
  101.    PartiNameHold: string[30];
  102.    PartiAddr1Hold: string[30];
  103.    PartiAddr2Hold: string[30];
  104.    PartiAddr3Hold: string[30];
  105.    PartiPhoneHold: string[30];
  106.    WhichIn: string[1];
  107.    WhichAlt: string[1];
  108.  
  109.  
  110.  
  111.  
  112.  
  113. {Draw the opening screen. Use TextColor and BackgroundColor to}
  114. {make display in reverse video.                               }
  115.  
  116. procedure DrawScreen;
  117. begin
  118.           ClrScr;
  119.           TextColor(0);
  120.           TextBackground(7);
  121.           for I := 1 to 23 do
  122.           begin
  123.                Writeln('     SIGN UP!       SIGN UP!       SIGN UP!       SIGN UP!       SIGN UP!     ');
  124.  
  125.           end;
  126.                  Write('     SIGN UP!       SIGN UP!       SIGN UP!       SIGN UP!       SIGN UP!     ');
  127.           TextColor(7);
  128.           TextBackground(0);
  129. end;
  130.  
  131. {A cheap explosion effect}
  132.  
  133. procedure MakeWindow;
  134. begin
  135.       Window(29,10,50,15);
  136.       ClrScr;
  137.       Delay(500);
  138.       Window(22,8,57,17);
  139.       ClrScr;
  140.       Delay(500);
  141.       Window(14,6,64,19);
  142.       ClrScr;
  143.       Delay(500);
  144.       Window(7,4,71,21);
  145.       ClrScr;
  146.       Delay(500);
  147.       Window(5,3,73,22);
  148.       ClrScr;
  149.       Delay(500);
  150.       Window(3,2,76,23);
  151.       ClrScr;
  152.       end;
  153.  
  154. {Title of the program and the egomaniac programmer's name.}
  155.  
  156. procedure Title;
  157.       begin
  158.       For I:= 1 to 6 do
  159.       Writeln;
  160.       Writeln('                              SIGN UP!');
  161.       Writeln;
  162.       Writeln;
  163.       Writeln;
  164.       Writeln;
  165.       Writeln('                                 by');
  166.       Writeln('                            James Edmunds');
  167.       Writeln('                             PO Box 2185');
  168.       Writeln('                            New Iberia, LA');
  169.       Writeln('                                70560');
  170.       end;
  171.  
  172.  
  173.  
  174.  
  175. {Checks to see if a file already exists}
  176. procedure CheckForTheFile;
  177.      begin
  178.      {$I-} Reset(CheckForFile) {$I+};  {Reset is an error if no file exists}
  179.      IsOne := (IOresult = 0);
  180.      end;
  181.  
  182.  
  183.  
  184.  
  185.  
  186. procedure Greeting;
  187.           begin
  188.                Assign(CheckForFile,'SKED.DTA');
  189.                CheckForTheFile;
  190.                If not IsOne then
  191.                begin
  192.                     ClrScr;
  193.                     Writeln(^G);
  194.                     Writeln('   This program allows the creation of a schedule of');
  195.                     Writeln('   up to 45 workshops, registration of participants');
  196.                     Writeln('   into those workshops, the printing of a complete');
  197.                     Writeln('   registration list, the onscreen viewing or printing');
  198.                     Writeln('   of individual workshop rosters, the limitation ');
  199.                     Writeln('   of class size and the listing of registrants as');
  200.                     Writeln('   alternates in classes that are full. It blocks');
  201.                     Writeln('   registration of participants not in the proper');
  202.                     Writeln('   age range but allows the registrar to override');
  203.                     Writeln('   the age limitation on an individual basis. Parti-');
  204.                     Writeln('   cipants are limited in the number of workshops for');
  205.                     Writeln('   which they may register and also for which they may');
  206.                     Writeln('   may be listed as alternates. Those limits are set');
  207.                     Writeln('   for the entire schedule by the registrar. The entire');
  208.                     Writeln('   program is menu-driven.');
  209.                     Writeln;
  210.                     Writeln('   (Press the space bar for more...)');
  211.                     Read(KBD,Ch);
  212.                     ClrScr;
  213.                     Writeln;
  214.                     Writeln('   It is advised that you begin by using a disk with only');
  215.                     Writeln('   the files with names beginning with "SIGNUP" and "COMMAND"');
  216.                     Writeln('   to run this program, as the program itself creates 48');
  217.                     Writeln('   additional files and all the disk space is needed');
  218.                     Writeln('   for data storage. When you wish to create an additional');
  219.                     Writeln('   schedule--next session, for instance--it is suggested');
  220.                     Writeln('   that you copy SIGNUP.COM (only!) onto a new, blank disk.');
  221.                     Writeln;
  222.                     Writeln;
  223.                     Writeln('   If you use this program and find it valuable, you are');
  224.                     Writeln('   asked to send 25.00 to James Edmunds, PO Box 2185, New Iberia,');
  225.                     Writeln('   Louisiana, 70560.');
  226.                     Write('   Do you wish a printout of that name and address? (Y/N) ');
  227.                     Repeat
  228.                           Read(KBD,Ch);
  229.                     Until UpCase(Ch) in ['Y','N'];
  230.                     Writeln(UpCase(Ch));
  231.                     If UpCase(Ch) = 'Y' then
  232.                     begin
  233.                          Writeln(Lst,'If you use SIGNUP and find it valuable, please');
  234.                          Writeln(Lst,'send 25.00 to:');
  235.                          Writeln(Lst,'     James Edmunds');
  236.                          Writeln(Lst,'     PO Box 2185');
  237.                          Writeln(Lst,'     New Iberia, LA  70560');
  238.                     end;
  239.                     Writeln;
  240.                     Writeln('   In no event does the programmer undertake any liability');
  241.                     Writeln('   with the regard to the performance of the program');
  242.                     Writeln('   or any situation arising from its use.');
  243.                     Writeln;
  244.                     Delay(3000);
  245.                     Write(^G);
  246.                     Write('   Press the space bar to continue...');
  247.                     Read(KBD,Ch);
  248.                end;
  249.           end;
  250.  
  251.  
  252.  
  253.  
  254.  
  255.  
  256. {The procedure lumping all the introductory stuff together}
  257. procedure Intro;
  258. begin
  259.      DrawScreen;
  260.      Delay(500);
  261.      MakeWindow;
  262.      Delay(250);
  263.      Title;
  264.      Delay(4000);
  265.      Greeting;
  266. end;
  267.  
  268.  
  269. {General purpose procedure to get an expression with regard to limit of}
  270. {length of string. Called with C=Column, R=Row, L=Length limit of      }
  271. {expression. Carriage return--Chr(13)--enters the expression into      }
  272. {desired location in calling routine. This is for strings.             }
  273. procedure GetExpression;
  274.      begin
  275.          Expression := '';
  276.          GotoXY(C,R);
  277.          Write('':L,'<<');
  278.          GotoXY(C,R);
  279.          Repeat
  280.          Read(KBD,Ch);
  281.          Expression := Expression + Ch; {Add each keystroke to string}
  282.          J := Length(Expression);
  283.          If Ch = Chr(8) then {Special routing for backspaces}
  284.          begin
  285.             If J = 1 then  {Special routine for backspace as first Ch}
  286.             begin
  287.               Write(^G);
  288.               Delete(Expression,J,1);
  289.             end;
  290.             If J <> 1 then
  291.             begin
  292.               Delete(Expression,J-1,2);
  293.               M := (C + (J - 2));
  294.               GotoXY(M,R);
  295.               Write(' ');
  296.               J := J - 1;
  297.             end;
  298.          end;
  299.          GotoXY(C,R);
  300.          Write(Expression);
  301.          If Ch = Chr(13) then L := L + 1;
  302.          If J > L then
  303.          begin
  304.               Write(^G); {Wipes it out with a beep if too long}
  305.               Expression := '';
  306.               GotoXY(C,R);
  307.               Write('':L,'<<      ');
  308.          end;
  309.          Until Ch = Chr(13);
  310.      end;
  311.  
  312. {Similar to GetExpression, but uses X as number length. Case of routine}
  313. {averts variable type error by locking out anything but numbers, back- }
  314. {spaces and Carriage returns}
  315. procedure GetNumber;
  316.      begin
  317.          Expression := '';
  318.          GotoXY(C,R);
  319.          Write('':X,'<<');
  320.          GotoXY(C,R);
  321.          Repeat
  322.                Repeat
  323.                    Beep := True; {Locks out letters, etc. Beeps if wrong}
  324.                    Read(KBD,Ch); {kind of key pressed}
  325.                    If Ch in ['0','1','2','3','4','5','6','7','8','9',Chr(8),Chr(13)] then
  326.                    begin
  327.                        Beep := False;
  328.                    end;
  329.                    If Beep = True then Write(^G);
  330.                Until Ch in ['0','1','2','3','4','5','6','7','8','9',Chr(8),Chr(13)];
  331.                Expression := Expression + Ch;
  332.                J := Length(Expression);
  333.                If Ch = Chr(8) then
  334.                begin
  335.                   If J = 1 then
  336.                   begin
  337.                     Write(^G);
  338.                     Delete(Expression,J,1);
  339.                   end;
  340.                   If J <> 1 then
  341.                   begin
  342.                     Delete(Expression,J-1,2);
  343.                     M := (C + (J - 2));
  344.                     GotoXY(M,R);
  345.                     Write(' ');
  346.                     J := J - 1;
  347.                  end;
  348.               end;
  349.               GotoXY(C,R);
  350.               Write(Expression);
  351.               If Ch = Chr(13) then X := X + 1;
  352.               If J > X then
  353.               begin
  354.                    Write(^G);
  355.                    Expression := '';
  356.                    GotoXY(C,R);
  357.                    Write('':X,'<<      ');
  358.               end;
  359.               Until Ch = Chr(13);
  360.               Val(Expression,K,O);
  361.               Number := K;
  362.      end;
  363.  
  364.  
  365.  
  366.  
  367. {Initializes SKED.DTA,etc. and moves to EditSched}
  368. procedure MakeSched;
  369.      begin
  370.      Writeln;
  371.      Writeln;
  372.      Writeln;
  373.      TextColor(15);
  374.      Writeln('        There is no schedule file on this disk.');
  375.      Writeln;
  376.      Write('        Do you wish to create a schedule? (Y/N) ');
  377.      Read(KBD,Choice);
  378.      Repeat until UpCase(Choice) in ['Y','N'];  {Falls through to menu on N}
  379.      Writeln(Choice);
  380.      Choic := UpCase(Choice);
  381.      If Choic = 'Y' then
  382.         begin
  383.            Writeln;
  384.            Writeln;
  385.            Writeln('        Please wait a moment while the program prepares');
  386.            Writeln('        the disk so that you may create a schedule.');
  387.            Assign(SchedFile,'SKED.DTA');
  388.            Rewrite(SchedFile);
  389.            with SchedRec do
  390.            begin
  391.              Workshop := '                  ';
  392.              When := ''; Who := ''; HowMany := 0; YoungestAge :=0; OldestAge := 0;
  393.              for I := 1 to MaxNoWorkshops do
  394.              begin
  395.                   WorkshopNumber := I;
  396.                   Write(SchedFile,SchedRec);
  397.              end;
  398.            end;
  399.            Close(SchedFile);
  400.            Assign(PartiFile,'PARTI.DTA');
  401.            Rewrite(PartiFile);
  402.            Close(PartiFile);
  403.            For I := 10 to 55 do   {Use 10 to 55 instead of 1 to 45 so Str function}
  404.            begin                  {can use 2 places consistently}
  405.                Str(I:2,RosterNumber);
  406.                RosterName := 'ROS.' + RosterNumber;
  407.                Assign(RostListFile,RosterName);
  408.                Rewrite(RostListFile);
  409.                Close(RostListFile);
  410.            end;
  411.          TextColor(7);
  412.          ClrScr;
  413.          Writeln;
  414.          Writeln;
  415.          Writeln;
  416.          Writeln('    Now, you must set a limit on the number of workshops');
  417.          Writeln('    for which each participant will be allowed to register.');
  418.          Writeln('    You may set that number as high as 10.');
  419.          Write('    Enter the maximum number of workshops per registrant:');
  420.          Repeat
  421.             Repeat
  422.                Repeat
  423.                  C := 62; R := 7; X := 2;
  424.                  GetNumber;
  425.                  If Number > 10 then Write(^G);
  426.                  If Number < 1 then Write(^G);
  427.                Until Number < 11;
  428.             Until Number > 0;
  429.             GotoXY(8,1);
  430.             Write('':69);
  431.             GotoXY(8,1);
  432.             Write('               Are you sure? (Y/N)');
  433.             Repeat
  434.                   Read(KBD,Ch);
  435.             Until UpCase(Ch) in ['Y','N'];
  436.             Write(UpCase(Ch));
  437.          Until UpCase(Ch) = 'Y';
  438.          MostWorkshops := Number;
  439.          ClrScr;
  440.          Writeln;
  441.          Writeln('    The program automatically registers participants as');
  442.          Writeln('    alternates when requested workshops are already full.');
  443.          Writeln('    You must specify the number of workshops for which one');
  444.          Writeln('    may register as an alternate. The minimum is 1, and the');
  445.          Writeln('    number may be as high as 10.');
  446.          Write('    Enter the maximum number for alternate listings:');
  447.          Repeat
  448.             Repeat
  449.                Repeat
  450.                  C := 62; R := 7; X := 2;
  451.                  GetNumber;
  452.                  If Number > 10 then Write(^G);
  453.                  If Number < 1 then Write(^G);
  454.                Until Number < 11;
  455.             Until Number > 0;
  456.             GotoXY(8,1);
  457.             Write('':69);
  458.             GotoXY(8,1);
  459.             Write('               Are you sure? (Y/N)');
  460.             Repeat
  461.                   Read(KBD,Ch);
  462.             Until UpCase(Ch) in ['Y','N'];
  463.             Write(UpCase(Ch));
  464.          Until UpCase(Ch) = 'Y';
  465.          MostAlternates := Number;
  466.          Assign(LimitFile,'LIMITS.DTA');ReWrite(LimitFile);
  467.          With LimitRec do
  468.          begin
  469.               WorkshopLimit := MostWorkshops;
  470.               AlternateLimit := MostAlternates;
  471.          end;
  472.          Write(LimitFile,LimitRec);
  473.          Close(LimitFile);
  474.          ClrScr;
  475.        end;
  476.      end;
  477.  
  478.  
  479.  
  480. procedure EditMessage;
  481.       begin
  482.           GotoXY(1,1);
  483.           Writeln('     Each workshop is assigned a number. To add a workshop, type in a');
  484.           Writeln('     number that has no name next to it and press <RETURN>.');
  485.           Writeln('     To edit information about a workshop that is listed, type the number');
  486.           Writeln('     to the left of its name and press <RETURN>.');
  487.           Writeln('     To exit from this function, type 0 and press <RETURN>.');
  488.       end;
  489.  
  490.  
  491. procedure RosterMessage;
  492.        begin
  493.             GotoXY(1,1);
  494.             Writeln('    Each workshop is assigned a number. To choose the');
  495.             Writeln('    workshop whose roster you wish to examine, type the');
  496.             Writeln('    number to the left of its name and press <RETURN>.');
  497.             Writeln('    To exit from this function, type 0 and press <RETURN>.');
  498.        end;
  499.  
  500.  
  501.  
  502.  
  503.  
  504. {Put the list of workshops on the screen and choose one to enter/edit}
  505. procedure ListWorkshops;
  506.      begin
  507.           for I := 1 to 74 do
  508.           begin
  509.                GotoXY(I,6);
  510.                Write(chr(205));
  511.           end;
  512.           Assign(SchedFile,'SKED.DTA');Reset(SchedFile);
  513.           for I := 1 to 9 do
  514.           begin
  515.                J := I + 6;       {Two routines in left-most column to}
  516.                GotoXY(4,J);      {keep numbers right-justified}
  517.                Write(I);
  518.                Seek(SchedFile,I-1); Read(SchedFile,SchedRec);
  519.                with SchedRec do
  520.                begin
  521.                    GotoXY(6,J);
  522.                    Write(Workshop);
  523.                end;
  524.           end;
  525.           for I := 10 to 15 do
  526.           begin
  527.                J := I + 6;
  528.                GotoXY(3,J);
  529.                Write(I);
  530.                Seek(SchedFile,I-1); Read(SchedFile,SchedRec);
  531.                with SchedRec do
  532.                begin
  533.                    GotoXY(6,J);
  534.                    Write(Workshop);
  535.                end;
  536.           end;
  537.           for I := 16 to 30 do {routine to display second column}
  538.           begin
  539.                J := I-9;
  540.                GotoXY(27,J);
  541.                Write(I);
  542.                Seek(SchedFile,I-1); Read(SchedFile,SchedRec);
  543.                with SchedRec do
  544.                begin
  545.                     GotoXY(30,J);
  546.                     Write(Workshop);
  547.                end;
  548.           end;
  549.           for I := 31 to 45 do    {third column}
  550.           begin
  551.                J := I-24;
  552.                GotoXY(51,J);
  553.                Write(I);
  554.                Seek(SchedFile,I-1); Read(SchedFile,SchedRec);
  555.                with SchedRec do
  556.                begin
  557.                     GotoXY(54,J);
  558.                     Write(Workshop);
  559.                end;
  560.           end;
  561.           TextColor(15);
  562.           Repeat
  563.           GotoXY(40,22);
  564.           Write('CHOICE: ');
  565.           C := 48; R := 22; X := 2; {Set location variables prior to calling}
  566.           GetNumber;
  567.           WorkshopChoice := Number;
  568.           If 45 < WorkshopChoice then
  569.           begin
  570.                GotoXY(1,1);
  571.                Sound(440);
  572.                Delay(300);
  573.                NoSound;
  574.                GotoXY(3,22);
  575.                Write('You must enter a number from 1 to 45, or 0 to exit. Try Again.');
  576.                Delay(5000);
  577.                GotoXY(3,22);
  578.                Write('':69);
  579.           end;
  580.           Until 46 > WorkshopChoice;   {0 falls through to menu}
  581.           Close(SchedFile);
  582.           TextColor(7);
  583.       end;
  584.  
  585.  
  586.  
  587. {Enter or edit a workshop}
  588. procedure EditWorkshop;
  589.       begin
  590.            ClrScr;
  591.            GotoXY(4,10);
  592.            Write('Workshop Title: ');
  593.            GotoXY(4,11);
  594.            Write('  Time & Place: ');
  595.            GotoXY(4,12);
  596.            Write('    Instructor: ');
  597.            GotoXY(4,13);
  598.            Write('   Class limit: ');
  599.            GotoXY(4,14);
  600.            Write('   Minimum age: ');
  601.            GotoXY(4,15);
  602.            Write('   Maximum age: ');
  603.            Assign(SchedFile,'SKED.DTA'); Reset(SchedFile);
  604.            Seek(SchedFile,WorkshopChoice-1); Read(SchedFile,SchedRec);
  605.            with SchedRec do
  606.            begin
  607.                 GotoXY(21,10);
  608.                 Write(Workshop);
  609.                 GotoXY(21,11);
  610.                 Write(When);
  611.                 GotoXY(21,12);
  612.                 Write(Who);
  613.                 GotoXY(21,13);
  614.                 Write(HowMany);
  615.                 GotoXY(21,14);
  616.                 Write(YoungestAge);
  617.                 GotoXY(21,15);
  618.                 Write(OldestAge);
  619.            end;
  620.            Close(SchedFile);
  621.            GotoXY(10,18);
  622.            Write('Do you wish to change the listing? (Y/N) ');
  623.            Repeat
  624.            Read(KBD,Choice);
  625.            Until UpCase(Choice) in ['Y','N'];  {Falls through to listings on N}
  626.            Choic := UpCase(Choice);
  627.            If Choic = 'Y' then
  628.            begin
  629.                 Write(Choic);
  630.                 GotoXY(10,18);
  631.                 Write('':50);
  632.                 Assign(SchedFile,'SKED.DTA'); Reset(SchedFile);
  633.                 Seek(SchedFile,WorkshopChoice-1); Read (SchedFile,SchedRec);
  634.                 With SchedRec do
  635.                 begin
  636.                     C := 21; {Set location, length variables before calling}
  637.                     R := 10;
  638.                     L := 18;
  639.                     GetExpression;
  640.                     Workshop := Expression;
  641.                     C := 21;
  642.                     R := 11;
  643.                     L := 40;
  644.                     GetExpression;
  645.                     When := Expression;
  646.                     C := 21;
  647.                     R := 12;
  648.                     L := 25;
  649.                     GetExpression;
  650.                     Who := Expression;
  651.                     C := 21;
  652.                     R := 13;
  653.                     X := 3;
  654.                     GetNumber;
  655.                     HowMany := Number;
  656.                     C := 21;
  657.                     R := 14;
  658.                     X := 3;
  659.                     GetNumber;
  660.                     YoungestAge := Number;
  661.                     C := 21;
  662.                     R := 15;
  663.                     X := 3;
  664.                     GetNumber;
  665.                     OldestAge := Number;
  666.                 end;
  667.                 Seek(SchedFile,WorkshopChoice-1);
  668.                 Write(SchedFile,SchedRec);
  669.            end;
  670.                 Close(SchedFile);
  671.                 ClrScr;
  672.       end;
  673.  
  674.  
  675.  
  676. {Add or change various workshops in schedule}
  677. procedure EditSched;
  678.      begin
  679.           Repeat
  680.           EditMessage;
  681.           ListWorkshops;
  682.           If WorkshopChoice <> 0 then
  683.           EditWorkshop;
  684.           Until WorkshopChoice = 0;
  685.      end;
  686.  
  687.  
  688.  
  689.  
  690. {The module for creating and adding to the workshop schedule}
  691. procedure Create;
  692.      begin
  693.      ClrScr;
  694.      Assign(CheckForFile,'SKED.DTA');
  695.      CheckForTheFile;
  696.      If not IsOne then MakeSched else EditSched;
  697.      end;
  698.  
  699.  
  700.  
  701. procedure RegistrationPrint;
  702.           begin
  703.                ClrScr;
  704.                GotoXY(10,10);
  705.                Write('Complete registration being printed...');
  706.                Assign(PartiFile,'PARTI.DTA');
  707.                Reset(PartiFile);
  708.                For I := 0 to FileSize(PartiFile) - 1 do
  709.                begin
  710.                     Seek(PartiFile,I);Read(PartiFile, PartiRec);
  711.                     with PartiRec do
  712.                     begin
  713.                          Writeln(Lst);
  714.                          Writeln(Lst,PartiNumber);
  715.                          Writeln(Lst,PartiName);
  716.                          Writeln(Lst,PartiAddr1);
  717.                          Writeln(Lst,PartiAddr2);
  718.                          Writeln(Lst,PartiAddr3);
  719.                          Writeln(Lst,PartiPhone);
  720.                          Writeln(Lst,'Age: ',PartiAge);
  721.                          If PartiIn1 > 0 then Writeln(Lst,'Is registered in: ',PartiIn1);
  722.                          If PartiIn2 > 0 then Writeln(Lst,'Is registered in: ',PartiIn2);
  723.                          If PartiIn3 > 0 then Writeln(Lst,'Is registered in: ',PartiIn3);
  724.                          If PartiIn4 > 0 then Writeln(Lst,'Is registered in: ',PartiIn4);
  725.                          If PartiIn5 > 0 then Writeln(Lst,'Is registered in: ',PartiIn5);
  726.                          If PartiIn6 > 0 then Writeln(Lst,'Is registered in: ',PartiIn6);
  727.                          If PartiIn7 > 0 then Writeln(Lst,'Is registered in: ',PartiIn7);
  728.                          If PartiIn8 > 0 then Writeln(Lst,'Is registered in: ',PartiIn8);
  729.                          If PartiIn9 > 0 then Writeln(Lst,'Is registered in: ',PartiIn9);
  730.                          If PartiIn10 > 0 then Writeln(Lst,'Is registered in: ',PartiIn10);
  731.                          If AltIn1 > 0 then Writeln(Lst,'Is an alternate in: ',AltIn1);
  732.                          If AltIn2 > 0 then Writeln(Lst,'Is an alternate in: ',AltIn3);
  733.                          If AltIn3 > 0 then Writeln(Lst,'Is an alternate in: ',AltIn3);
  734.                          If AltIn4 > 0 then Writeln(Lst,'Is an alternate in: ',AltIn4);
  735.                          If AltIn5 > 0 then Writeln(Lst,'Is an alternate in: ',AltIn5);
  736.                          If AltIn6 > 0 then Writeln(Lst,'Is an alternate in: ',AltIn6);
  737.                          If AltIn7 > 0 then Writeln(Lst,'Is an alternate in: ',AltIn7);
  738.                          If AltIn8 > 0 then Writeln(Lst,'Is an alternate in: ',AltIn8);
  739.                          If AltIn9 > 0 then Writeln(Lst,'Is an alternate in: ',AltIn9);
  740.                          If AltIn10 > 0 then Writeln(Lst,'Is an alternate in: ',AltIn10);
  741.                          Writeln(Lst);
  742.                          Writeln(Lst);
  743.                    end;
  744.                end;
  745.                Close(PartiFile);
  746.                Writeln(Lst,Chr(12));
  747.           end;
  748.  
  749.  
  750. procedure RosterScreen;
  751.           begin
  752.              ClrScr;
  753.              Assign(SchedFile,'SKED.DTA');
  754.              Reset(SchedFile);
  755.              Seek(SchedFile,WorkshopChoice - 1);
  756.              Read(SchedFile,SchedRec);
  757.              With SchedRec do
  758.              begin
  759.                   J := HowMany;   {Used to screen alternates}
  760.              end;
  761.              R := WorkshopChoice + 10;
  762.              Str(R:2,RosterNumber);
  763.              RosterName := 'ROS.' + RosterNumber;
  764.              Assign(RostListFile,RosterName);
  765.              Reset(RostListFile);
  766.              For I := 0 to FileSize(RostListFile) - 1 do
  767.              begin
  768.                    A := I +1;
  769.                    D := A;
  770.                    If A > 20 then if A < 41 then
  771.                    begin
  772.                         If A = 21 then
  773.                         begin
  774.                              GotoXY(4,A);
  775.                              Write('Press space bar to list more registrants...');
  776.                              Read(KBD,Ch);
  777.                              ClrScr;
  778.                         end;
  779.                         A := A - 20;
  780.                    end;
  781.                    If A > 40 then if A < 61 then
  782.                    begin
  783.                         If A = 41 then
  784.                         begin
  785.                              GotoXY(4,21);
  786.                              Write('Press space bar to list more registrants...');
  787.                              Read(KBD,Ch);
  788.                              ClrScr;
  789.                         end;
  790.                         A := A - 40;
  791.                    end;
  792.                    If A > 60 then if A < 81 then
  793.                    begin
  794.                         If A = 61 then
  795.                         begin
  796.                              GotoXY(4,21);
  797.                              Write('Press space bar to list more registrants...');
  798.                              Read(KBD,Ch);
  799.                              ClrScr;
  800.                         end;
  801.                         A := A - 60;
  802.                    end;
  803.                    Seek(RostListFile,I);Read(RostListFile,RostRec);
  804.                    with RostRec do
  805.                    begin
  806.                         If AltFlag = False then
  807.                         begin
  808.                             GotoXY(3,A);
  809.                             Write(PartiRosterNumber);
  810.                             GotoXY(8,A);
  811.                             Write(D);
  812.                             GotoXY(12,A);
  813.                             Write(PartiRosterName);
  814.                             GotoXY(45,A);
  815.                             Write(PartiRosterPhone);
  816.                             B := I + 1;
  817.                         end;
  818.                   end;
  819.             end;
  820.             GotoXY(4,21);
  821.             Write('Press space bar to list alternates...');
  822.             Read(KBD,Ch);
  823.             ClrScr;
  824.             For I := 0 to FileSize(RostListFile) - 1 do
  825.             begin
  826.                    A := I +1;
  827.                    D := A;
  828.                    If A > 20 then if A < 41 then
  829.                    begin
  830.                         If A = 21 then
  831.                         begin
  832.                              GotoXY(4,A);
  833.                              Write('Press space bar to list more alternates...');
  834.                              Read(KBD,Ch);
  835.                              ClrScr;
  836.                         end;
  837.                         A := A - 20;
  838.                    end;
  839.                    If A > 40 then if A < 61 then
  840.                    begin
  841.                         If A = 41 then
  842.                         begin
  843.                              GotoXY(4,21);
  844.                              Write('Press space bar to list more alternates...');
  845.                              Read(KBD,Ch);
  846.                              ClrScr;
  847.                         end;
  848.                         A := A - 40;
  849.                    end;
  850.                    If A > 60 then  if A < 81 then
  851.                    begin
  852.                         If A = 61 then
  853.                         begin
  854.                              GotoXY(4,21);
  855.                              Write('Press space bar to list more alternates...');
  856.                              Read(KBD,Ch);
  857.                              ClrScr;
  858.                         end;
  859.                         A := A - 60;
  860.                    end;
  861.                    Seek(RostListFile,I);Read(RostListFile,RostRec);
  862.                    with RostRec do
  863.                    begin
  864.                         If AltFlag = True then
  865.                         begin
  866.                             GotoXY(3,A);
  867.                             Write(PartiRosterNumber);
  868.                             GotoXY(8,A);
  869.                             Write(D);
  870.                             GotoXY(12,A);
  871.                             Write(PartiRosterName);
  872.                             GotoXY(45,A);
  873.                             Write(PartiRosterPhone);
  874.                             B := I + 1;
  875.                             GotoXY(65,A);
  876.                             Write('**Alt');
  877.                         end;
  878.                   end;
  879.            end;
  880.            Close(RostListFile);
  881.            GotoXY(4,A +1);
  882.            Write('Press space bar to return to Roster listing menu...');
  883.            Read(KBD,Ch);
  884.            ClrScr;
  885.       end;
  886.  
  887. procedure RosterPrint;
  888.           begin
  889.              ClrScr;
  890.              Assign(SchedFile,'SKED.DTA');
  891.              Reset(SchedFile);
  892.              Seek(SchedFile,WorkshopChoice - 1);
  893.              Read(SchedFile,SchedRec);
  894.              With SchedRec do
  895.              begin
  896.                   J := HowMany;
  897.                   Writeln(Lst);
  898.                   Writeln(Lst,Workshop);
  899.                   Writeln(Lst,When);
  900.                   Writeln(Lst,Who);
  901.                   Writeln(Lst,'Class limit: ',HowMany);
  902.                   Writeln(Lst,'Minimum Age: ',YoungestAge);
  903.                   Writeln(Lst,'Maximum Age: ',OldestAge);
  904.                   Writeln(Lst);
  905.                   Writeln(Lst,'Roster of those registered for class: ');
  906.                   Writeln(Lst);
  907.                   Writeln(Lst,'Reg #');
  908.              end;
  909.              Close(SchedFile);
  910.              R := WorkshopChoice + 10;
  911.              Str(R:2,RosterNumber);
  912.              RosterName := 'ROS.' + RosterNumber;
  913.              Assign(RostListFile,RosterName);
  914.              Reset(RostListFile);
  915.              For I := 0 to FileSize(RostListFile) - 1 do
  916.              begin
  917.                    Seek(RostListFile,I);Read(RostListFile,RostRec);
  918.                    with RostRec do
  919.                    begin
  920.                         AltFlagger := AltFlag;
  921.                    end;
  922.                    If AltFlagger = False then
  923.                    begin
  924.                        A := I + 1;
  925.                        D := A;
  926.                        Seek(RostListFile,I);Read(RostListFile,RostRec);
  927.                        with RostRec do
  928.                        begin
  929.  
  930.                         Writeln(Lst,PartiRosterNumber:3,D:8,PartiRosterName:40,PartiRosterPhone:63);
  931.  
  932.                        end;
  933.                    end;
  934.              end;
  935.              For I := 0 to FileSize(RostListFile) - 1 do
  936.              begin
  937.                    Seek(RostListFile,I);Read(RostListFile,RostRec);
  938.                    With RostRec do
  939.                    begin
  940.                          AltFlagger := AltFlag;
  941.                    end;
  942.                    If AltFlagger = True then
  943.                    begin
  944.                        A := I + 1;
  945.                        D := A;
  946.                        Seek(RostListFile,I);Read(RostListFile,RostRec);
  947.                        with RostRec do
  948.                        begin
  949.                             Entry := '**Alt';
  950.                             Writeln(Lst,PartiRosterNumber:3,D:8,PartiRosterName:40,PartiRosterPhone:63,Entry:75);
  951.                        end;
  952.                   end;
  953.             end;
  954.             Close(RostListFile);
  955.             Writeln(Lst,Chr(12));
  956.             ClrScr;
  957.           end;
  958.  
  959.  
  960.  
  961.  
  962.  
  963. procedure GiveRoster;
  964.           begin
  965.                ClrScr;
  966.                GotoXY(1,10);
  967.                Writeln('   Indicate that you want to see the roster on the');
  968.                Writeln('   screen by typing <S> or on the printer by typing <P>.');
  969.                Writeln;
  970.                Write('   What is your choice? (S/P) ');
  971.                Repeat
  972.                      Read(KBD,Ch);
  973.                Until UpCase(Ch) in ['S','P'];
  974.                Case UpCase(Ch) of
  975.                     'S' : RosterScreen;
  976.                     'P' : RosterPrint;
  977.                end;
  978.           end;
  979.  
  980.  
  981.  
  982.  
  983.  
  984.  
  985.  
  986.  
  987. procedure RosterChoice;
  988.            begin
  989.                 Repeat
  990.                      RosterMessage;
  991.                      ListWorkshops;
  992.                      If WorkshopChoice <> 0 then
  993.                      GiveRoster;
  994.                 Until WorkshopChoice = 0;
  995.            end;
  996.  
  997.  
  998.  
  999.  
  1000.  
  1001.  
  1002. procedure RosterExamine;
  1003.           begin
  1004.                ClrScr;
  1005.                RosterChoice;
  1006.  
  1007.           end;
  1008.  
  1009.  
  1010.  
  1011.  
  1012.  
  1013. procedure SelectOption;
  1014.           begin
  1015.                ClrScr;
  1016.                for I := 1 to 74 do
  1017.                begin
  1018.                     GotoXY(I,6);
  1019.                     Write(chr(205));
  1020.                end;
  1021.                GotoXY(4,2);
  1022.                Write('Select whether you would like a complete registration');
  1023.                GotoXY(4,3);
  1024.                Write('printout or you would like to examine roster listings');
  1025.                GotoXY(4,4);
  1026.                Write('by keying the appropriate letter.');
  1027.                TextColor(15);
  1028.                GotoXY(10,10);
  1029.                Write('C');
  1030.                GotoXY(10,12);
  1031.                Write('R');
  1032.                GotoXY(10,14);
  1033.                Write('X');
  1034.                TextColor(7);
  1035.                GotoXY(14,10);
  1036.                Write('Complete registration printout');
  1037.                GotoXY(14,12);
  1038.                Write('Roster listings');
  1039.                GotoXY(14,14);
  1040.                Write('Exit this function, return to menu');
  1041.                Repeat
  1042.                     Read(KBD,Choice);
  1043.                Until UpCase(Choice) in ['C','R','X'];
  1044.                Choic := UpCase(Choice);
  1045.                Case Choic of
  1046.                     'C' : RegistrationPrint;
  1047.                     'R' : RosterExamine;
  1048.                end;                  {X falls through to earlier menu}
  1049.           end;
  1050.  
  1051.  
  1052.  
  1053.  
  1054.  
  1055.  
  1056. {Examines--and prints--rosters for individual workshops}
  1057. procedure Examine;
  1058.      begin
  1059.           ClrScr;
  1060.           Assign(CheckForFile,'SKED.DTA');
  1061.           CheckForTheFile;
  1062.           If IsOne then
  1063.           begin
  1064.                Repeat
  1065.                SelectOption;
  1066.                Until Choic = 'X'
  1067.           end;
  1068.      end;
  1069.  
  1070.  
  1071. {Check to see if want a printed copy each time....and whether to form}
  1072. {feed each one}
  1073.  
  1074. procedure PrintOrNo;
  1075.      begin
  1076.           ClrScr;
  1077.           PrintReg := false;
  1078.           FormFeed := false;
  1079.           Writeln;
  1080.           Writeln;
  1081.           Writeln;
  1082.           Writeln('    Do you wish a printed record of each registration to');
  1083.           Write('    to be produced at the time each registration is made? (Y/N) ');
  1084.           Repeat
  1085.                 Read(KBD,Ch)
  1086.           Until UpCase(Ch) in ['Y','N'];
  1087.           Write(Ch);
  1088.           If UpCase(Ch) = 'Y' then PrintReg := True;
  1089.           If UpCase(Ch) = 'Y' then
  1090.           begin
  1091.                Writeln;
  1092.                Writeln;
  1093.                Writeln('    To make the registration records print one per');
  1094.                Writeln('    page, type < F >. To make them print on a continuous');
  1095.                Write('    sheet, type  < C >. Your choice: (F,C) ');
  1096.                Repeat
  1097.                      Read(KBD,Ch)
  1098.                Until UpCase(Ch) in ['F','C'];
  1099.                Write(Ch);
  1100.                If UpCase(Ch) = 'F' then FormFeed := True;
  1101.           end;
  1102.      end;
  1103.  
  1104.  
  1105.  
  1106. procedure AlternateRegister;
  1107.           begin
  1108.                If NumberAltIn > MostAlternates - 1 then  {Can register as alternate only}
  1109.                begin                                     {so many times                 }
  1110.                      GotoXY(4,10);
  1111.                      Write(^G,'This workshop is full, and registrant is already       ');
  1112.                      GotoXY(4,11);
  1113.                      Write('an alternate in the maximum number of workshops.');
  1114.                end
  1115.                else
  1116.                begin
  1117.                      If NumberIn = MostWorkshops then
  1118.                      begin
  1119.                          GotoXY(4,10);
  1120.                          Write(^G,'The registrant will listed as                       ');
  1121.                      end
  1122.                      else
  1123.                      begin
  1124.                          GotoXY(4,10);
  1125.                          Write(^G,'This workshop is full. The registrant will listed as');
  1126.                      end;
  1127.                      GotoXY(4,11);
  1128.                      Write('as an alternate.                                             ');
  1129.                      If PrintReg = True then
  1130.                      begin
  1131.                           Writeln(Lst);
  1132.                           Writeln(Lst,'You are registered as an alternate in:');
  1133.                           Writeln(Lst,Entry);
  1134.                           Writeln(Lst,Expression);
  1135.                      end;
  1136.                      NumberAltIn := NumberAltIn + 1;
  1137.                      AltFlagger := True;
  1138.                      Assign(PartiFile,'PARTI.DTA'); Reset(PartiFile);
  1139.                      Z := FileSize(PartiFile) - 1;
  1140.                      Seek(PartiFile,Z);
  1141.                      With PartiRec do
  1142.                      begin
  1143.                        case NumberAltIn of         {Record registration as}
  1144.                          1 : AltIn1 := WorkshopChoice;   {an alternate}
  1145.                          2 : AltIn2 := WorkshopChoice;
  1146.                          3 : AltIn3 := WorkshopChoice;
  1147.                          4 : AltIn4 := WorkshopChoice;
  1148.                          5 : AltIn5 := WorkshopChoice;
  1149.                          6 : AltIn6 := WorkshopChoice;
  1150.                          7 : AltIn7 := WorkshopChoice;
  1151.                          8 : AltIn8 := WorkshopChoice;
  1152.                          9 : AltIn9 := WorkshopChoice;
  1153.                          10 : AltIn10 := WorkshopChoice;
  1154.                        end;
  1155.                        Write(PartiFile,PartiRec);
  1156.                     end;
  1157.                     Close(PartiFile);
  1158.                     Assign(PartiFile,'PARTI.DTA');Reset(PartiFile);
  1159.                     Seek(PartiFile,FileSize(PartiFile) - 1);
  1160.                     Read(PartiFile,PartiRec);
  1161.                     with PartiRec do
  1162.                     begin
  1163.                          V := PartiNumber;
  1164.                     end;
  1165.                     Close(PartiFile);
  1166.                     Assign(RostListFile,RosterName);Reset(RostListFile);
  1167.                     Seek(RostListFile,R);
  1168.                     With RostRec do
  1169.                     begin
  1170.                          PartiRosterNumber := V;
  1171.                          PartiRosterName := PartiNameHold;
  1172.                          PartiRosterPhone := PartiPhoneHold;
  1173.                          AltFlag := AltFlagger;
  1174.                     end;
  1175.                     Write(RostListFile,RostRec);
  1176.                     Close(RostListFile);
  1177.                end;
  1178.           end;
  1179.  
  1180.  
  1181.  
  1182.  
  1183.  
  1184.  
  1185.  
  1186.  
  1187. procedure Transfer;
  1188.     begin
  1189.           Okay := False;
  1190.           AgeSkip := False;
  1191.           Repeat
  1192.            Repeat
  1193.              GotoXY(4,10);
  1194.              Write('':69);
  1195.              GotoXY(4,11);
  1196.              Write('':69);
  1197.              GotoXY(4,9);
  1198.              Write('':69);
  1199.              GotoXY(4,9);
  1200.              Write('Enter the number of the workshop desired:               ');
  1201.              C := 60; R := 9; X := 2;
  1202.              GetNumber; WorkshopChoice := Number;
  1203.              If WorkshopChoice > 45 then Write(^G);
  1204.              If WorkshopChoice < 1 then Write(^G);
  1205.              Yes := False;
  1206.              If WorkshopChoice < 46 then if WorkshopChoice > 0 then Yes := True;
  1207.            Until Yes = True;
  1208.            Assign(SchedFile, 'SKED.DTA'); Reset(SchedFile);
  1209.            Seek(SchedFile,WorkshopChoice - 1);Read(SchedFile,SchedRec);
  1210.            With SchedRec do
  1211.            begin
  1212.                 Entry := Workshop;
  1213.                 Expression := When;
  1214.                 Y := YoungestAge;
  1215.                 O := OldestAge;
  1216.                 L := HowMany;
  1217.            end;
  1218.            Close(SchedFile);
  1219.            H := PartiAgeHold;
  1220.            If PartiAgeHold > O then
  1221.            begin
  1222.                 GotoXY(4,10);
  1223.                 Write(^G,'The registrant is too old for this workshop. Press');
  1224.                 GotoXY(4,11);
  1225.                 Write('Do you wish to register for another workshop? (Y/N) ');
  1226.                 Repeat
  1227.                      Read(KBD,Ch);
  1228.                 Until UpCase(Ch) in ['Y','N','X'];
  1229.                 Write(UpCase(Ch));
  1230.                 If UpCase(Ch) = 'X' then   {Allow operator override without showing}
  1231.                 begin              {that option on the screen.}
  1232.                      H := O;
  1233.                      GotoXY(4,10);
  1234.                      Write(^G,'Age mismatch overridden by registrar...                 ');
  1235.                      GotoXY(4,11);
  1236.                      Write('Registration process continues...                      ');
  1237.                      Delay(3500);
  1238.                 end;
  1239.                 If UpCase(Ch) = 'N' then
  1240.                 begin
  1241.                      Stopper := True;
  1242.                      AgeSkip := True;
  1243.                      H := O;
  1244.                 end;
  1245.            end;
  1246.            If PartiAgeHold < Y then
  1247.            begin
  1248.                 GotoXY(4,10);
  1249.                 Write(^G,'The registrant is too young for this workshop.      ');
  1250.                 GotoXY(4,11);
  1251.                 Write('Do you wish to register for another workshop? (Y/N) ');
  1252.                 Repeat
  1253.                      Read(KBD,Ch);
  1254.                 Until UpCase(Ch) in ['Y','N','X'];
  1255.                 Write(UpCase(Ch));
  1256.                 If UpCase(Ch) = 'X' then
  1257.                 begin
  1258.                      H := Y;
  1259.                      GotoXY(4,10);
  1260.                      Write(^G,'Age mismatch overridden by registrar...             ');
  1261.                      GotoXY(4,11);
  1262.                      Write('Registration process continues...                      ');
  1263.                      Delay(3500);
  1264.                 end;
  1265.                 If UpCase(Ch) = 'N' then
  1266.                 begin
  1267.                      Stopper := True;
  1268.                      AgeSkip := True;
  1269.                      H := Y;
  1270.                end;
  1271.            end;
  1272.            If O >= H then if H >= Y then Okay := True;
  1273.           Until Okay = True;
  1274.   {**} If AgeSkip = False then
  1275.        begin
  1276.           J := WorkshopChoice + 10;
  1277.           Str(J:2,RosterNumber);
  1278.           RosterName := 'ROS.' + RosterNumber;
  1279.           Assign(RostListFile,RosterName); Reset(RostListFile);
  1280.           R := FileSize(RostListFile);
  1281.           Close(RostListFile);
  1282.           B := R + 1;
  1283.           If B > L then if NumberAltIn <> MostAlternates then
  1284.           begin
  1285.                AlternateRegister;
  1286.           end
  1287.           else
  1288.           begin
  1289.                GotoXY(4,10);
  1290.                Write('The workshop is full and the registrant is already     ');
  1291.                GotoXY(4,11);
  1292.                Write('an alternate in the maximum number of workshops.       ');
  1293.           end;
  1294.           If B <= L then if NumberIn = MostWorkshops then AlternateRegister;
  1295.           If B <= L then if NumberIn <> MostWorkshops then
  1296.           begin
  1297.                      NumberIn := NumberIn + 1;
  1298.                      AltFlagger := False;
  1299.                      Assign(PartiFile,'PARTI.DTA'); Reset(PartiFile);
  1300.                      Z := FileSize(PartiFile) - 1;
  1301.                      Seek(PartiFile,Z);
  1302.                      With PartiRec do
  1303.                      begin
  1304.                        case NumberIn of
  1305.                          1 : PartiIn1 := WorkshopChoice;
  1306.                          2 : PartiIn2 := WorkshopChoice;
  1307.                          3 : PartiIn3 := WorkshopChoice;
  1308.                          4 : PartiIn4 := WorkshopChoice;
  1309.                          5 : PartiIn5 := WorkshopChoice;
  1310.                          6 : PartiIn6 := WorkshopChoice;
  1311.                          7 : PartiIn7 := WorkshopChoice;
  1312.                          8 : PartiIn8 := WorkshopChoice;
  1313.                          9 : PartiIn9 := WorkshopChoice;
  1314.                          10 : PartiIn10 := WorkshopChoice;
  1315.                        end;
  1316.                        Write(PartiFile,PartiRec);
  1317.                     end;
  1318.                     Close(PartiFile);
  1319.                     Assign(PartiFile,'PARTI.DTA');Reset(PartiFile);
  1320.                     Seek(PartiFile,FileSize(PartiFile) - 1);
  1321.                     Read(PartiFile,PartiRec);
  1322.                     With PartiRec do
  1323.                     begin
  1324.                         V := PartiNumber;
  1325.                     end;
  1326.                     Close(PartiFile);
  1327.                     Assign(RostListFile,RosterName);Reset(RostListFile);
  1328.                     Seek(RostListFile,R);
  1329.                     With RostRec do
  1330.                     begin
  1331.                          PartiRosterNumber := V;
  1332.                          PartiRosterName := PartiNameHold;
  1333.                          PartiRosterPhone := PartiPhoneHold;
  1334.                          AltFlag := AltFlagger;
  1335.                     end;
  1336.                     Write(RostListFile,RostRec);
  1337.                     Close(RostListFile);
  1338.                     GotoXY(4,11);
  1339.                     Write('Registration successful...                                  ');
  1340.                     If PrintReg = False then
  1341.                     begin
  1342.                          Delay(3000);
  1343.                          Write(^G);
  1344.                     end;
  1345.                     If PrintReg = True then
  1346.                     begin
  1347.                          Writeln(Lst);
  1348.                          Writeln(Lst,'You are registered in: ');
  1349.                          Writeln(Lst,Entry);
  1350.                          Writeln(Lst,Expression);
  1351.                     end;
  1352.           end;
  1353.           If NumberIn = MostWorkshops then if NumberAltIn = MostAlternates then
  1354.           begin
  1355.                GotoXY(4,11);
  1356.                Write('':69);
  1357.                GotoXY(4,10);
  1358.                Write('':69);
  1359.                Stopper := True;
  1360.           end;
  1361.           If NumberIn = MostWorkshops then if NumberAltIn <> MostAlternates then
  1362.           begin
  1363.                GotoXY(4,10);
  1364.                Write('You have register successfully for the maximum');
  1365.                GotoXY(4,11);
  1366.                Write('number of workshops, but may still be listed as an');
  1367.                GotoXY(4,12);
  1368.                Write('alternate if you wish to register for another workshop.');
  1369.                GotoXY(4,13);
  1370.                Write('Do you wish to register for another workshop? (Y/N) ');
  1371.                Repeat
  1372.                   Read(KBD,Ch);
  1373.                Until UpCase(Ch) in ['Y','N'];
  1374.                Write (UpCase(Ch));
  1375.                If UpCase(Ch) = 'N' then Stopper := True;
  1376.                If UpCase(Ch) = 'Y' then
  1377.                begin
  1378.                          GotoXY(4,12);
  1379.                          Write('':69);
  1380.                          GotoXY(4,13);
  1381.                          Write('':69);
  1382.               end;
  1383.           end;
  1384.           If NumberIn <> MostWorkshops then
  1385.           begin
  1386.                GotoXY(4,13);
  1387.                Write('Do you wish to register for another workshop? (Y/N) ');
  1388.                Repeat
  1389.                      Read(KBD,Ch);
  1390.                Until UpCase(Ch) in ['Y','N'];
  1391.                Write(UpCase(Ch));
  1392.                If UpCase(Ch) = 'N' then Stopper := True;
  1393.                If UpCase(Ch) = 'Y' then
  1394.                begin
  1395.                     GotoXY(4,12);
  1396.                     Write('':69);
  1397.                     GotoXY(4,13);
  1398.                     Write('':69);
  1399.                end;
  1400.           end;
  1401. {**}    end;
  1402.     end;
  1403.  
  1404.  
  1405.  
  1406. procedure RegisterParti;
  1407.      begin
  1408.        PrintOrNo;{find out whether to turn printer on}
  1409.        Stopper := False;
  1410.        Repeat
  1411.          Stopper := False;
  1412.          ClrScr;
  1413.          Writeln;
  1414.          Writeln('    Registrant''s Name: '); {Get input of name, etc.}
  1415.          Writeln('              Address: ');
  1416.          Writeln('              Address: ');
  1417.          Writeln('              Address: ');
  1418.          Writeln('            Telephone: ');
  1419.          Writeln('                  Age: ');
  1420.          Writeln;
  1421.          C := 24;
  1422.          R := 2;
  1423.          L := 30;
  1424.          GetExpression;
  1425.          PartiNameHold := Expression;
  1426.          C := 24;
  1427.          R := 3;
  1428.          L := 30;
  1429.          GetExpression;
  1430.          PartiAddr1Hold := Expression;
  1431.          C := 24;
  1432.          R := 4;
  1433.          L := 30;
  1434.          GetExpression;
  1435.          PartiAddr2Hold := Expression;
  1436.          C := 24;
  1437.          R := 5;
  1438.          L := 30;
  1439.          GetExpression;
  1440.          PartiAddr3Hold := Expression;
  1441.          C := 24;
  1442.          R := 6;
  1443.          L := 14;
  1444.          GetExpression;
  1445.          PartiPhoneHold := Expression;
  1446.          C := 24;
  1447.          R := 7;
  1448.          X := 3;
  1449.          GetNumber;
  1450.          PartiAgeHold := Number;
  1451.          Assign(PartiFile,'PARTI.DTA');Reset(PartiFile);
  1452.          Seek(PartiFile,FileSize(PartiFile));
  1453.          With PartiRec do
  1454.          begin
  1455.               PartiNumber := FileSize(PartiFile) + 1;
  1456.               PartiName := PartiNameHold;
  1457.               PartiAddr1 := PartiAddr1Hold;
  1458.               PartiAddr2 := PartiAddr2Hold;
  1459.               PartiAddr3 := PartiAddr3Hold;
  1460.               PartiPhone := PartiPhoneHold;
  1461.               PartiAge := PartiAgeHold;
  1462.               PartiIn1 := 0;
  1463.               PartiIn2 := 0;
  1464.               PartiIn3 := 0;
  1465.               PartiIn4 := 0;
  1466.               PartiIn5 := 0;
  1467.               PartiIn6 := 0;
  1468.               PartiIn7 := 0;
  1469.               PartiIn8 := 0;
  1470.               PartiIn9 := 0;
  1471.               PartiIn10 := 0;
  1472.               AltIn1 := 0;
  1473.               AltIn2 := 0;
  1474.               AltIn3 := 0;
  1475.               AltIn4 := 0;
  1476.               AltIn5 := 0;
  1477.               AltIn6 := 0;
  1478.               AltIn7 := 0;
  1479.               AltIn8 := 0;
  1480.               AltIn9 := 0;
  1481.               AltIn10 := 0;
  1482.          end;
  1483.          Write(PartiFile,PartiRec);
  1484.          Close(PartiFile);
  1485.          NumberIn := 0;      {Start counters of number of registrations}
  1486.          NumberAltIn := 0;
  1487.          Assign(LimitFile,'LIMITS.DTA');Reset(LimitFile);
  1488.          Seek(LimitFile,FileSize(LimitFile) - 1);
  1489.          Read(LimitFile,LimitRec);
  1490.          With LimitRec do
  1491.          begin
  1492.               MostWorkshops := WorkshopLimit;
  1493.               MostAlternates := AlternateLimit;
  1494.          end;
  1495.          Close(LimitFile);
  1496.          If PrintReg = True then
  1497.          begin
  1498.               Writeln(Lst,PartiNameHold);
  1499.               Writeln(Lst,PartiAddr1Hold);
  1500.               Writeln(Lst,PartiAddr2Hold);
  1501.               Writeln(Lst,PartiAddr3Hold);
  1502.               Writeln(Lst,PartiPhoneHold);
  1503.          end;
  1504.          Repeat
  1505.          Transfer;
  1506.          Until Stopper = True;
  1507.          If PrintReg = True then
  1508.          begin
  1509.               If FormFeed = True then
  1510.               Write(Lst,Chr(12))
  1511.               else
  1512.               Writeln(Lst);
  1513.               Writeln(Lst);
  1514.          end;
  1515.          GotoXY(4,10);
  1516.          Write(^G,'This completes the registration for this registrant.   ');
  1517.          GotoXY(4,11);
  1518.          Write('':69);
  1519.          GotoXY(4,11);
  1520.          Write('Do you wish to register another participant? (Y/N) ');
  1521.          GotoXY(4,12);
  1522.          Write('':69);
  1523.          GotoXY(4,13);
  1524.          Write('':69);
  1525.          Repeat
  1526.                Read(KBD,Ch);
  1527.          Until UpCase(Ch) in ['Y','N'];
  1528.          Write(Ch);
  1529.       Until UpCase(Ch) = 'N';
  1530.      end;
  1531.  
  1532.  
  1533.  
  1534.  
  1535.  
  1536.  
  1537.  
  1538.  
  1539.  
  1540.  
  1541.  
  1542. {Module to register participants in workshops...makes them alternates}
  1543. {if desired workshop is filled}
  1544. procedure Register;
  1545.      begin
  1546.           ClrScr;
  1547.           Assign(CheckForFile,'SKED.DTA');
  1548.           CheckForTheFile;
  1549.           If not IsOne then MakeSched else RegisterParti;
  1550.  
  1551.      end;
  1552.  
  1553.  
  1554.  
  1555.  
  1556.  
  1557.  
  1558. {The opening menu. Return to this procedure at the end of each}
  1559. {module of SIGN UP! Use TextColor change to get high video.   }
  1560.  
  1561. procedure OpenMenu;
  1562.      begin
  1563.      ClrScr;
  1564.      Writeln;
  1565.      Writeln;
  1566.      Writeln('         Choose from the following SIGN UP! program options');
  1567.      Writeln('         by keying the letter corresponding to your choice.');
  1568.      Writeln('         Example: Type "Q" to quit.');
  1569.      for I := 1 to 74 do
  1570.      begin
  1571.      GotoXY(I,7);
  1572.      Write(chr(205));
  1573.      end;
  1574.      TextColor(15);
  1575.      GotoXY(10,9);
  1576.      Write('C');
  1577.      GotoXY(10,11);
  1578.      Write('E');
  1579.      GotoXY(10,13);
  1580.      Write('R');
  1581.      GotoXY(10,15);
  1582.      Write('Q');
  1583.      TextColor(7);
  1584.      GotoXY(15,9);
  1585.      Write('Create, view or edit a workshop schedule');
  1586.      GotoXY(15,11);
  1587.      Write('Examine or print a workshop roster or regristant list');
  1588.      GotoXY(15,13);
  1589.      Write('Register participants in workshops');
  1590.      GotoXY(15,15);
  1591.      Write('Quit SIGN UP! (Return to DOS)');
  1592.      end;
  1593.  
  1594.  
  1595. procedure ChooseMenu;
  1596.      begin
  1597.      Repeat
  1598.      Read(KBD,Choice)
  1599.      Until UpCase(Choice) in ['C','E','R','Q'];
  1600.      Choic := UpCase(Choice);
  1601.      Case Choic of
  1602.      'C': Create;
  1603.      'E': Examine;
  1604.      'R': Register; {Q falls through to program block, hence to DOS}
  1605.      end;
  1606.      end;
  1607.  
  1608.  
  1609. {The choice of which module made here}
  1610. procedure ChooseModule;
  1611.      begin
  1612.      OpenMenu;
  1613.      ChooseMenu;
  1614.      end;
  1615.  
  1616.  
  1617. {The program}
  1618. begin
  1619.      Intro;
  1620.      Repeat
  1621.      ChooseModule
  1622.      Until Choic = 'Q';
  1623.      ClrScr;
  1624. end.